package com.djinfo.work.common.service;

import com.djinfo.work.util.PageSet;

import java.io.Serializable;
import java.util.List;

/**
 * Created by lenovo on 2017/4/28.
 */
public interface BaseService<T> {
    public void save(T entity);

    public void delete(T entity);

    public void update(T entity);

    public Object getByPrimaryKey(Class object, String pkID);

    public <T> T getEntity(Class entityName, Serializable id);

    public <T> List<T> loadAll(final Class<T> entityClass);

    public void updateBySqlString(final String query);

    public void delSome(String hql);

    public PageSet queryPage(T entity, Integer pageNum, Integer pageSize);
    public List<T> queryList(T entity);
    //批量插入
    public void saveList(List<T> list);
    /**
     * 按属性查找对象.
     */
    public <T> T findUniqueByProperty(Class<T> entityClass,String propertyName, Object value);

    /**
     * 按属性查找对象列表.
     */
    public <T> List<T> findByProperty(Class<T> entityClass,String propertyName, Object value);
}
